package com.ding.second.action;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.ding.second.po.Admin;
import com.ding.second.service.AdminService;

@Controller
@RequestMapping("/admin")
public class AdminAction{
	
	@Autowired
	private AdminService adminServer;
	
	@RequestMapping("/login")
	public String login (Admin admin){
		Map<String, Object> adminAccount = new HashMap<String, Object>();
		adminAccount.put("adminAccount", admin.getAdminAccount());
		adminAccount.put("adminPsw", admin.getAdminPsw());
		String adminName = adminServer.getAdmin(adminAccount);
		if (adminName == null) {
			return "adminLogin";
		}
		return "one";
	}
	
	

}
